#include "pet.h"
#include "ui_pet.h"
#include "windows.h"
#include "QTimer"
Pet::Pet(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::Pet)
{
    ui->setupUi(this);
    ui->im->setPixmap(QPixmap(":/img2/1.png"));
    setWindowFlags(Qt::FramelessWindowHint|Qt::WindowStaysOnTopHint);  //取消窗体功能，同时保证窗体的置顶
    this->setAttribute(Qt::WA_TranslucentBackground, true);            //设置窗体透明
    QTimer::singleShot(0, this, SLOT(sl()));
}

Pet::~Pet()
{
    delete ui;
}


void Pet::sl()
{
    SetWindowPos(HWND(this->winId()), HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW);
}
